package net.yihang.miaosha.domain;

import net.yihang.miaosha.redis.AbstractKey;

public class GoodsKey extends AbstractKey {
    // 不过期
    public GoodsKey(String key) {
        super(0, key);
    }

    public static GoodsKey idKey(long id) {
        return new GoodsKey("Goods.id:" + id);
    }

    public static GoodsKey uuidKeyToId(String uuid) {
        return new GoodsKey("Goods.uuid.id:" + uuid);
    }

    public static GoodsKey uuidKeyToStock(String uuid) {
        return new GoodsKey("Goods.uuid.stock:" + uuid);
    }

    public static GoodsKey htmlKey(long id) {
        return new GoodsKey("Goods.html.id:" + id);
    }

    public static GoodsKey stockKey(long id) {
        return new GoodsKey("Goods.stock:id:" + id);
    }

    public static GoodsKey lockKey(long id) {
        return new GoodsKey("Goods.lock:id:" + id);
    }
}
